<template>
  <div v-if="v.id">
    <div class="list-item">
      <slot name="prefix"></slot>
      <div class="left">
        <img :src="v.images[0]" alt="" />
      </div>
      <div class="right">
        <h3>{{ v.title }}</h3>
        <div class="desc">
          <slot name="desc">{{ v.descs[0] }}</slot>
        </div>
        <div>
          <span class="price">{{ v.price }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'
defineProps(['v'])
</script>

<style lang="scss" scoped>
.list-item {
  display: flex;
  border-bottom: 1px solid #ccc;
  margin: 10px 0;
  .left {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
  .price {
    color: red;
    font-size: 20px;
    font-weight: bold;
    &::before {
      content: '￥：';
    }
  }
}
</style>
